#include<stdio.h>
int main()
{
    int d,x;
    scanf("%d",&d);
    x=d+2;
    x=x%7;
    if(x==0) x=7;
    printf("%d",x);
    return 0;
}
